<%@ Language=VBScript %>
<%Option Explicit%>

<!--#include file="../cons.asp"-->
<!--#include file="../../Common/Database.asp"-->

<%
	response.CacheControl = "no-cache"

	Dim IdAlumnoCurso, nota, operacion, Trimestre
	Dim oConn, sSQL, oRS

	Set oConn = OpenConnection

	IdAlumnoCurso = trim(request("IdAlumnoCurso"))
	nota = trim(request("nota"))
	operacion = trim(request("operacion"))
	trimestre = trim(request("trimestre"))
	
	if operacion = "INSERT" then
		sSQL = "INSERT into Nota (nota, IdAlumnoCurso, Trimestre, IdQuincena) values (" & nota & ", " & IdAlumnoCurso & ", " & trimestre & ", 1)"
	end if
	
	if operacion = "UPDATE" then
		sSQL = "UPDATE Nota set Nota = " & nota & " where IdAlumnoCurso = " & IdAlumnoCurso & " and Trimestre = " & trimestre
	end if
	
	if operacion = "DELETE" then
		sSQL = "DELETE from Nota where IdAlumnoCurso = " & IdAlumnoCurso & " and Trimestre = " & trimestre
	end if
	
	'response.Write sSQL
	Set oRS = oConn.Execute(sSQL)
%>